-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add slicer plugin #6857
Add slicer plugin #6857
Conversation
I appreciate the functionality but this is not the way to add slicing and tempo stretching. These stuff should either go into afp (slicing is already partially implemented there) or sample tracks (where they make sense). |
Also, forgot to mention that slicing is already possible in the nightly using the knife tool. |
I disagree, i wouldn't see why it should go into AFP at all, considering a sampler and a sample slicer serve different purposes and there wouldn't be a way to merge both flawlessly imo. About slicing on samples tracks, that's already been implemented, but It once again server a different purpose imo. This is a slicer plugin like ninjas2 and it would really help workflow with sliced vocal chops or drums beat like amen break and such, something where using samples tracks would be way more inefficient. I do appreciate the effort and imo is still something to consider to have in LMMS. About the GUI i could try sketching something up if i get some free time, or anyway you could probably find someone else to help about it on LMMS discord as well, unless you plan to design it yourself. |
I feel like afp would not be the correct place to add slicing, since its purpose is more the playback of a single file. Also it uses the piano roll to pitch shift already, so you would not be able to use it to play different slices. This and afp have totally separate use cases. |
Any help would be appreciated, I am not very good at UI design, but of course only if this is something acceptable to include in LMMS. |
I just want to say that I was planning on creating a plugin like this, well done! I have some old FL projects I can't import because LMMS has no Beat/Fruity Slicer. AFP kinda seems like the wrong place for slicing, bc you would have to check some kind of keyboard tracking switch to have each note map to a slice or to pitch shift the sample, but not both at once. I will be helping with this when I get time because this is a killer feature. +100 you win the Internet. |
Sorry for the confusion, i got confused between sample slicing and chopping. Since i haven't used slicing in any way till now, i can't say anything. Whatever i said was regarding chopping. |
I began working on this awhile back, although I never really continued with it. It would be nice if someone could pick it up because I'm focusing on more pressing issues in the codebase. I attached an image below of what I had, just a simple interface, but uses Qt layouts and a larger window. The latter is important as it allows for more freedom moving the slice positions. For a larger window, I just had a "Show GUI" button that would open the larger slicer plugin. Having a larger window is just part of my vision for the plugin. Someone else may have a different vision, but a larger window would probably be nice all round. A lot could go into this. Depending on how far you want to stretch, users may request ability to timestretch and pitchshift specific slices (we would probably have to pull in another library for this), ability to choose cues like in Serato Sample (or onsets like in Ninjas2). You don't have to worry about adding those features, they can always be added later, but I think having a spacious interface and ability to add slice markers and move them around is enough for now. |
good to know that I'm not alone in wanting this, feel free to help however you want.
ok, no problem.
I wanted to avoid a larger window at the beginning to fit in with the other plugins, so I just added a seeker to place slices with precision. However, If I want to add any more functionality like effects or whatever I will do this. As for needing another library to time and pitch shift, the code for that is already implemented, although pitch shifting doesn't quite work yet. Since this does seem like something that could be added, I will continue working on it. |
I've never worked with slicers before. The closest I've been is sitting next to someone working with Recycle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just dropping some general remarks on coding style.
Done. Also renamed icon to logo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving for merge.
Is there any chance that in the future (or even in this PR) we'd want to assign a different purpose to keys outside the range used by the individual slices? For example, maybe we would want keys below the root key (and below the key that allows the entire sample to play) to play slices in reverse or on loop or something? If we merge now then in the future decide that we want to give all those wasted keys a new purpose, it would require an upgrade routine. But if we disallow those notes from being played right now, we wouldn't need an upgrade routine in the future. |
Maybe the base note (A4 by default) could be the note that loops the entire sample (instead of being the 1st slice), then notes above that would play the slices like normal, and notes below that could have a special purpose in the future. Notes outside the range would play nothing. |
Not in this PR, but yes, maybe in the future I can make the bottom keys play in reverse or something similar. I mostly want to get this merged soon, and in the future I'll probably come back to expand the plugin a bit more.
Done, now only the base note plays the full sample. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good, and I haven't had any issues while testing.
Looks like there might be a memory leak.. I'll look into this soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found the source of the memory leak
Co-authored-by: Dalton Messmer <[email protected]>
@DanielKauss If you're satisfied with the PR, I can go ahead and merge. |
Fine by me! |
Great work! Thank you for contributing! |
Thanks! And also thank you to everyone who helped! |
This ish gonna be killa. sony acid had this feature. as a beatmaker , thanks for this |
@DanielKauss Awesome work!... I've been troubleshooting SlicerT since I've had issues with noise after merge into master. One issue I found is that we do division with 0 when fadeOut is 0. With Thread 37 "AudioEngine::fi" received signal SIGFPE, Arithmetic exception.
[Switching to Thread 0x7fff79494640 (LWP 90724)]
0x00007fff4283d138 in lmms::SlicerT::playNote (this=0x7ffff27f0680, handle=0x7ffff2750e60, workingBuffer=0x7fff41331880) at /home/zonkmachine/builds/lmms/plugins/SlicerT/SlicerT.cpp:138
138 float fadeValue = static_cast<float>(noteFramesLeft - i) / fadeOutFrames; |
I believe this is the PR that creates noise. The line below has been removed from the other native plugins since #6867 lmms/plugins/SlicerT/SlicerT.cpp Line 146 in 609c008
|
Thanks for finding these issues. I'll open another PR later that fixes this. I'll also add reversed slices, since it seems like a few people want that. |
This is by far the sleekest looking inbuilt plugin we have. Props to the creator. |
@zonkmachine I opened up the bug fix PR here #6992, with additional support for reversed slices
I agree, @RoxasKH did an amazing job! |
In my mind, a slice has 3 components: An ID |
This PR adds a very basic sample slicer. The main features are:
The UI is still in the works at the moment.
I have no experience in music production and wanted to start with LMMS, but noticed it doesn't include a slicer, so I tried making one. I don't have a lot of samples to test it so feedback would be appreciated.
I am sorry if this is inadequate for the main repo, this is my first time contributing. But if it is something worthwhile I will continue working on it.